{% extends "default.html" %}

{% block content %}
<div class="title">
	Administraci&oacute;n de Monedas
</div>
<div class="content">
	<div>Las monedas con las que el sistema trabaja actualmente son:</div>
	<table id="itemtemplate_table">
		<tr>
			<th>Nombre</th>
			<th>S&iacute;mbolo</th>
			<th>Valor en Bs</th>
			<th>Acci&oacute;n</th>
		</tr>
		{% if request.currencies %}
			{% for currency in request.currencies %}
			<tr>
				<td>{{ currency.name }}</td>
				<td>{{ currency.symbol }}</td>
				<td>{{ currency.multiplier }} Bs</td>
				<td>
					<form action="/currency/modify/" method="post">
						<input type="hidden" name="currency_id" value="{{ currency.id }}">
						<input type="text" name="new_value" value="{{ currency_value }}">
						<input type="submit" value="Modificar valor">
					</form>
				</td>
			</tr>
			{% endfor %}
		{% else %}
		<tr>
			<td colspan="4">No se han registrado monedas</td>
		</tr>
		{% endif %}
	</table>
	<div>Para ingresar una nueva moneda, ingrese aqu&iacute; la informaci&oacute;n</div>
	<form action="/currency/register/" method="post">
		<table id="item_table_register">
			<tr>
				<th>Nombre</th>
				<td><input type="text" name="name" autocomplete='off'></td>
			</tr>
			<tr>
				<th>S&iacute;mbolo</th>
				<td><input type="text" name="symbol" autocomplete='off'></td>
			</tr>
			<tr>
				<th>Precio en Bs</th>
				<td><input type="text" name="multiplier" autocomplete='off'></td>
			</tr>
			<tr>
				<td colspan="2">
					<input type="submit" value="Registrar">
				</td>
			</tr>
		</table>
	</form>
	
</div>	
{% endblock %}